package com.bana.fvs.app.mvp.model;

import com.bana.fvs.app.mvp.ConstantsValue;
import com.bana.fvs.app.mvp.contract.UserInfoContract;
import com.wei.commonlibrary.net.OkhttpRequest;
import com.wei.commonlibrary.net.ResultCallback;

import java.util.HashMap;

/**
 * Created by ${wei} on 2017/4/14.
 */

public class UserInfoModel extends UserInfoContract.AbsUserInfoModel {
    @Override
    public OkhttpRequest http_logout(String token) {
        HashMap<String,Object> map = new HashMap<>();
        map.put(ConstantsValue.TOKEN,token);
        return okhttpRequest.url(iApiService.logout(map));
    }

    @Override
    public void http_updatePhone(String token, String phone, ResultCallback<String> callback) {
        HashMap<String,Object> map = new HashMap<>();
        map.put(ConstantsValue.TOKEN,token);
        map.put(ConstantsValue.SJ,phone);
        okhttpRequest.url(iApiService.updateUserPhone(map))
        .callback(callback);
    }

    @Override
    public OkhttpRequest http_getUserInfo(String token) {
        HashMap<String,Object> map = new HashMap<>();
        map.put(ConstantsValue.TOKEN,token);
        return okhttpRequest.url(iApiService.getUserInfo(map));
    }

    @Override
    public void onStart() {

    }
}
